﻿Public Class ven_pol4

    Private Sub btnok_ven_pol4_Click(sender As Object, e As EventArgs) Handles btnok_ven_pol4.Click
        yc4 = Convert.ToSingle(txtyc4_jp4.Text)
        fp14 = Convert.ToSingle(txt_fp14.Text)
        fp24 = Convert.ToSingle(txt_fp24.Text)
        dp14 = Convert.ToSingle(txt_dp14.Text)
        dp24 = Convert.ToSingle(txt_dp24.Text)
        tetap4 = Convert.ToSingle(txt_tetap4.Text)
        decp4 = Convert.ToSingle(txt_decp4.Text)

        tetap4 = tetap4 * (3.141592 / 180)
        alfap4 = Math.Asin((dp24 - dp14) / (2 * decp4))

        fxcp4 = -Math.Cos(alfap4) * (fp14 + fp24)
        fzcp4 = Math.Sin(alfap4) * (fp14 - fp24)

        fxp4 = fxcp4 * Math.Cos(tetap4) - fzcp4 * Math.Sin(tetap4)
        fzp4 = fxcp4 * Math.Sin(tetap4) + fzcp4 * Math.Cos(tetap4)

        c4x = fxp4
        c4y = 0
        c4z = fzp4
        m4x = 0
        m4y = -(fp14 + fp24) * dp14 * 0.5
        m4z = 0

        Me.Close()
    End Sub
End Class